package com.frxuexi.lib_base.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.frxuexi.lib_base.entity.EmpBean
import com.frxuexi.lib_base.entity.UserEntity


@Dao
interface EmpDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun addEmp(empBean: EmpBean):Long


    @Query("select * from emp order by id desc limit 0,1")
//    @Query("select * from emp where id=1")
    fun getEmp():EmpBean

    @Query("select * from emp order by id desc")
//    @Query("select * from emp where id=1")
    fun getAllEmps():List<EmpBean>

    @Update
    fun updateEmp(empBean: EmpBean):Int

    @Delete
    fun deleteEmp(empBean: EmpBean):Int



}